﻿
@{
    ViewBag.Title = "Hub";
}
<script src="~/Scripts/jquery-3.1.1.min.js"></script>
<script src="~/Scripts/jquery.signalR-2.2.1.min.js"></script>
<script src="~/signalr/hubs"></script>
<h2>Hub</h2>

<script>
    var chatHub = $.connection.myHub1;
    $(function () {
        console.log(chatHub);
        $.extend(chatHub.client, {
            Hello: function (msg, ac) { },
            GetState: function () {
                console.log('GetState');
                return true;
            }
        });

        load();
    });
    function hello() { }
    function load() {
        $.connection.hub.start().then(function () {
            //chatHub.server.sendSysMessageToPage({ a: '1' });

        }).done(function (state) {
            console.log('启动长链接');


        });
    }
</script>